package com.sky.sentinel.web;

import com.sky.sentinel.service.ISentinelService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class SentinelController {
    @Resource
    private ISentinelService sentinelService;

    @GetMapping("/hello")
    public String hello(@RequestParam("name") String name){
        return sentinelService.sayHello(name);
    }

    @GetMapping("/circuitBreaker")
    public String circuitBreaker(@RequestParam("name") String name){
        return sentinelService.circuitBreaker(name);
    }
}
